<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // 正则的方法  test    测试字符串中是否与这个正则相匹配

        var reg = /good/;

        console.log(reg.test('hi Good hello'));

    </script>

</body>

</html>